package io.gbznt.modules.buss.service;

import com.baomidou.mybatisplus.extension.service.IService;
import io.gbznt.common.utils.PageUtils;
import io.gbznt.modules.buss.entity.BussRtuRecordEntity;
import io.gbznt.modules.buss.entity.BussRtuWarningRecordEntity;

import java.io.DataOutputStream;
import java.util.List;
import java.util.Map;

/**
 * RTU_报文记录
 *
 * @author gbznt
 * @email http://www.gbznt.com/
 * @date 2019-04-20 15:48:34
 */
public interface BussRtuRecordService extends IService<BussRtuRecordEntity> {

	PageUtils queryPage(Map<String, Object> params);
	
	List<BussRtuRecordEntity>  queryPagetotal(Map<String, Object> params);
	
	List<BussRtuRecordEntity>  queryPagetotal12(Map<String, Object> params);

	/**
	 * 解析并添加报文
	 * 
	 * @param baowen
	 *            报文数组
	 * @param type
	 *            报文类型
	 * @param bw
	 *            原报文
	 * @return
	 */
	boolean addRtuRecord(String[] baowen, Integer type, String bw,DataOutputStream dos,Integer count);

	/**
	 * 根据报文触发预警规则添加告警记录
	 * 
	 * @param rtuRecord
	 * @return
	 */
	boolean addGjjlByBw(BussRtuRecordEntity rtuRecord);

	/**
	 * 根据报警记录添加工单
	 * 
	 * @return
	 */
	boolean addGdByGjjl(BussRtuWarningRecordEntity gjjl, String gjjb, Integer type);
	
	/**
	 * 获取时间最晚的上行报文
	 * @param params
	 * @return
	 */
	List<BussRtuRecordEntity> getSxbw();
}
